import time
from Page.Page import Page
from selenium.webdriver.common.by import By
class Page2(Page):
    # 搜索框输入
    sreach_loc=(By.CLASS_NAME,'search-form')
    # 点击搜索
    sreachbtn_loc=(By.CLASS_NAME,'search-btn')
    #点击商品
    shop_loc=(By.XPATH,'/html/body/div[6]/div/div[2]/div[5]/ul/li[1]/div[2]/div[1]/a/img')
    #点击加入购物车
    gwc_loc=(By.ID,'addToCartForDetail')
    #查看
    gwclook_loc=(By.NAME,'detail_chakangouwuche')
    # 点击去结算
    js_loc = (By.CLASS_NAME,'done')
    # 点击提交订单
    content_loc = (By.ID, 'submitOrder')

    def sreach(self):
        self.send_keys(self.sreach_loc,'白云边')

    def sreschbtn(self):
        self.click(self.sreachbtn_loc)

    def shop(self):
        self.click(self.shop_loc)

    def gwc(self):
        self.click(self.gwc_loc)

    def gwclook(self):
        self.click(self.gwclook_loc)

    def js(self):
        self.click(self.js_loc)

    def content(self):
        self.click(self.content_loc)

#     业务2逻辑
    def jiuian_luoji3(self):
        self.jiuxian_luoji1()
        time.sleep(2)
        self.sreach()
        self.sreschbtn()
        self.shop()
        self.content_page()
        self.scroll(200)
        self.gwc()
        self.gwclook()
        self.content_page()
        self.js()
        self.content_page()
        self.scroll(200)
        self.content()










